﻿
#include <iostream>
#include <vector>
#include"AVL.h"
int main()
{
	//bit::AvlTree<int, int> t;
	//int i = 10000;
	//srand(time(0));
	//while (i)
	//{
	//	int a = rand();
	//	t.Insert(make_pair(a, a));
	//	i--;
	//}
	/*随机数的访问是0~32767*/
	//所以avl树最多有32767个节点..
	const int N = 1000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));

	for (size_t i = 0; i < N; i++)
	{
		int a = rand();
		v.push_back(a);
	}

	bit::AvlTree<int, int> avlt;
	for (auto e : v)
	{

		avlt.Insert(make_pair(e, e));
		//cout << "Insert:" << e << "->" << avlt.IsBalance() << endl;
	}
	cout << avlt.IsBalance() << endl;
	cout << avlt.Height() << endl;


	return 0;
}
